<?php
/**
 * 
 * 팀 정보 model
 * @author gudals
 *
 */

class modelContTeamInfo extends modelContBase
{
    /**
     * 
     * 팀 등록
     * @param array $aReq 등록정보
     * @return boolean
     */
    public function insert($aReq)
    {
        if (empty($aReq)) return false;
        
        $sQuery = "
            insert into team_info (
                team_name
            ) values (
                '".$aReq['team_name']."'
            )
        ";
        
        $this->executeQuery($sQuery, 'exec');
        return $this->lastInsertID();
    }
    
    /**
     * 
     * 팀 정보 수정
     * @param array $aReq
     * @return boolean|Ambigous <NULL, multitype:void , void, unknown>
     */
    public function update($aReq)
    {
        if (empty($aReq)) return false;
        
        $sQuery = "
            update
                team_info
            set
                team_name = '".$aReq['team_name']."'
            where
                team_no = '".$aReq['team_no']."'
        ";
        
        return $this->executeQuery($sQuery, 'exec');
    }
    
    /**
     * 
     * 팀 삭제
     * @param int $iTeamNo 팀번호
     * @return boolean|Ambigous <NULL, multitype:void , void, unknown>
     */
    public function delete($iTeamNo)
    {
        if (empty($iTeamNo)) return false;
        
        $sQuery = "
            delete
            from
                team_info
            where
                team_no = '".$iTeamNo."'
        ";
        
        return $this->executeQuery($sQuery, 'exec');
    }
    
    /**
     * 
     * 팀 리스트
     * @return Ambigous <NULL, multitype:void , void, unknown>
     */
    public function getList()
    {
        $sQuery = "
            select
                *
            from
                team_info
        ";
        
        return $this->executeQuery($sQuery, 'rows');
    }
}